package com.lukebang.service.serviceImpl;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.lukebang.dao.CityCostRuleDAO;
import com.lukebang.dao.CustomerAddressDAO;
import com.lukebang.pojo.CityCostRule;
import com.lukebang.pojo.CustomerAddress;
import com.lukebang.service.ICityCostRuleService;

/**
 * 
 * CityCostRuleServiceImpl 上午11:15:31
 * 
 * Copyright zhaocj Inc. All rights reserved.
 * Love ME Like Justin Bieber.
 */
@Service("cityCostRuleService")
public class CityCostRuleServiceImpl implements ICityCostRuleService {
	@Resource
	CityCostRuleDAO cityCostRuleDAO;
	@Resource
	CustomerAddressDAO customerAddressDAO;

	@Override
	public CityCostRule selectCostRuleByCityCode(String cityCode) {
		return cityCostRuleDAO.selectCostRuleByCityCode(cityCode, 1);
	}

	@Override
	public CityCostRule queryCostRuleByIndent(Integer indentID) {
		CustomerAddress customerAddress = customerAddressDAO.selectCustomerAddressByIndent(indentID);
		return cityCostRuleDAO.selectCostRuleByCityCode(customerAddress.getCuAddressCodeStr(), 1);
	}
}
